Player = {}
Player.__index = Player
 
function Player.new()
    local instance = {
      gold = 0,
      name = "Player",
      ownerName = nil,
      ownedBuildings = {},
      ownedUnits = {},
      LocY
    }
    
    setmetatable(instance, Player)
    return instance
end

function Player:getOwnerName()
  return self.ownerName
end

function Player:setOwnerName(_ownerName)
  self.ownerName = _ownerName
end

function Player:getOwnedUnitsList()
  return self.ownedUnits
end

function Player:addUnitToList(_unit)
  self.ownedUnits[_unit] = _unit
end

function Player:removeunitFromList(_unit)
  self.ownedUnits[_unit] = nil
end

function Player:getOwnedBuildingsList()
  return self.ownedBuildings
end

function Player:addBuildingToList(_building)
  self.ownedBuildings[_building] = _building
end

function Player:removeBuildingFromList(_building)
  self.ownedBuildings[_building] = nil
end

function Player:getGold()
  return self.gold
end

function Player:setGold(_gold)
  self.gold = _gold
end

function Player:increaseGold(goldToAdd)
  temp = self.gold + goldToAdd
  self.gold = temp
end

function Player:decreaseGold(goldToDecrease)
  temp = self.gold - goldToDecrease
  self.gold = temp
end

function Player:getName()
  return self.name
end

function Player:setName(_name)
  self.name = _name
end

function Player:getHQLocY()
  return self.LocY
end

function Player:setHQLocY(_LocY)
  self.LocY = _LocY
end
 
return Player